<!-- B页面 -->
<template>
  <view class="img_page">
    <view class="closeImg">
		<image  @click="close" src="@/static/Myimg/cha.png" mode=""></image>
    </view>
	 <image  @click="close" class="touxiang" :src="imgurl" mode="aspectFill"></image>
 
   <ul class="under_banner">
	  <li class="list_item" @click="getPhoto">
		  <text>上传新的头像</text>
		  <image src="@/static/Myimg/photo album.png" mode=""></image>
	  </li>
	  <li class="list_item" style="border-bottom: none;">
	  		  <text style="">获取头像挂件</text>
	  		  <image src="@/static/Myimg/guajian.png"  style="width: 55rpx;height: 55rpx;padding-right: -20rpx; " mode=""></image>
	  </li>
	  </ul>
  </view>
</template>

<script>
export default {
	onLoad(options){
		console.log(options);
		this.imgurl=options
	},
  data() {
    return {
      imgurl: '' // 初始化为空字符串
    };
  },
  methods:{
	  close(){
		  uni.navigateBack({
			  delta:1
		  })
	  },
	  getPhoto(){
		  uni.chooseImage({
		  	count: 1,
		  	sourceType: ['camera'],
		  	success: (res) => {
		  		this.mediaUrl = res.tempFilePaths[0];
		  		this.mediaType = 'photo';
		  	},
		  	fail: (err) => {
		  		console.error('拍照失败', err);
		  	}
		  });
	  }
  },
  onLoad(e) {
    // 接收传递的图片路径
    this.imgurl = decodeURIComponent(e.imgUrl);
  }
};
</script>

<style scoped>
page {
  background-color: #000;
  color: #fff;
}
.img_page{
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	
}
.closeImg{
	width: 100%;
	height: 80rpx;
	margin-top: 100rpx;
}
.closeImg image{
	width: 70rpx;
	height: 70rpx;
	padding-left: 10rpx;
}

.touxiang {
	width: 660rpx;
	height: 660rpx;
	border-radius: 50%;
	margin-top: 160rpx;
	margin-left: 45rpx;
}
.under_banner{
	width: 660rpx;
	height: 180rpx;
	border-radius: 20rpx;
	margin-top: 270rpx;
	margin-left: 45rpx;
	background-color: rgb(34, 34, 34);
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	list-style: none;
   
}
.list_item {
	width: 660rpx;
	height: 90rpx;
	border-bottom: 1rpx solid rgb(60, 60, 60);
	display: flex;
    justify-content: space-around;
}
.list_item text{
	font-size: 38rpx;
	font-family: "黑体";
	line-height: 90rpx;
	display: block;  
	margin-right: 300rpx;
}
.list_item image{
	width: 70rpx;
	height: 70rpx;
	padding-top: 15rpx;
}

</style>
